﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using NLBS.Data;
using NLBS.Entity;
using NLBS.Framework;
using System.Text;
using NLBS.Web.UI;
using NLBS.Data.Business;
using NLBS.Web;
using NLBS.Views;
using NLBS.Text;

namespace NLBS.Control
{
    public partial class firstContent : BaseUserControl, IFirstContentView
    {
        #region Presenter

        private FirstContentPresenter _presenter;

        public FirstContentPresenter Presenter
        {
            get
            {
                if (this._presenter == null)
                    _presenter = new FirstContentPresenter();
                this._presenter.View = this;
                return _presenter;
            }
        }

        protected void PresenterInit()
        {
            if (!this.IsPostBack)
            {
                this.Presenter.OnViewInitialized();
            }
            this.Presenter.OnViewLoaded();
        }

        #endregion

        protected void BindArticle()
        {
            singleArticleRP.DataSource = contentList;
            singleArticleRP.DataBind();
        }

        #region IFirstContentView Members

        public int articleID
        {
            get { return RequestWrapper.GetQueryInt("ID"); }
        }

        private IList<Article> _contentList;
        public IList<Article> contentList
        {
            set
            {
                _contentList = value;
            }
            get
            {
                return _contentList;
            }
        }

        private bool _commentView;
        public bool commentView
        {
            get
            {
                return _commentView;
            }
            set
            {
                _commentView = value;
               commentForm1.Visible = _commentView;
            }
        }

        private bool _articleView;
        public bool articleView
        {
            get
            {
                return _articleView;
            }
            set
            {
                _articleView = value;
            }
        }

        #endregion
    }
}